﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;
using iTFF.WPF.UI;

namespace iTFF.WPF.View
{
    /// <summary>
    /// Interaction logic for ToasterView.xaml
    /// </summary>
    public partial class ToasterView : Window
    {

        bool _isGlassActivated;

        public ToasterView(bool isGlassActivated)
        {
            _isGlassActivated = isGlassActivated;

            // allow transparency if NOT glass effect
            this.AllowsTransparency = !_isGlassActivated;

            this.ResizeMode = _isGlassActivated ? ResizeMode.CanResize : ResizeMode.NoResize;

            InitializeComponent();
        }

        protected override void OnSourceInitialized(EventArgs e)
        {
            base.OnSourceInitialized(e);

            if (_isGlassActivated)
                GlassHelper.ExtendGlassFrame(this, new Thickness(-1));
            else
                // set backgorund to transparent
                GlassHelper.SetWindowTransparent(this);
        }
    }
}
